part of 'header.dart';

class UsuallyView extends StatelessWidget {
  UsuallyView({Key? key}) : super(key: key);
  final MeController controller = Get.find<MeController>();
  List<Widget> _getItems() {
    List<Widget> _items = [];
    for (var i = 0; i < controller.state.usuallyList.length * 2 - 1; i++) {
      if (i % 2 == 0) {
        var j = i ~/ 2;
        var mod = controller.state.usuallyList[j];
        _items.add(MenuItemView(
            icon: Icon(
              mod.iconData,
              size: 24.w,
              color: ColorsUtil.title,
            ),
            title: Text(
              mod.name,
              style: pfSCStyle(color: ColorsUtil.title, fontSize: font13),
            )));
      } else {
        //此为分割线
        _items.add(Container(
          height: 15.3.w,
          width: 1.w,
          color: const Color(0x33333333),
        ));
      }
    }
    return _items;
  }

  @override
  Widget build(BuildContext context) {
    return Container(
      width: Get.width,
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
        children: _getItems(),
      ),
    );
  }
}
